package com.chensf.studydemo.guide.animation

import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import com.chensf.studydemo.R
import kotlinx.android.synthetic.main.activity_motion_demo1.*
import kotlinx.coroutines.*

class MotionDemo1 : AppCompatActivity(){
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_motion_demo1)

        lifecycleScope.launch {
            withContext(Dispatchers.IO){
                delay(2000)
                Log.d("foo", "delay1")
            }
            motionLayout.transitionToEnd()
            val result = withContext(Dispatchers.IO){
                Log.d("foo", "delay2")
                1
            }
//            motionLayout.transitionToStart()

        }
    }
}